var mongoose = require('mongoose')

var Schema = mongoose.Schema

mongoose.connect('mongodb://localhost:27017/itstudent')

var commentSchema = new Schema({
    name:{
        type: String,
        require:true
    },
    gender:{
        type: Number,
        //加约束  必须是0或者1
        enum:[0,1],
        // 默认是0
        default:0
    },
    age:{
        type: Number

    },
    hobbies:{
        type: String
    }
})

//直接导出模型构造函数
module.exports = mongoose.model('Stundet',commentSchema)